Skip to main content
Version: 4.2

MQTT Integration

This section lists messages you can send to supOS through MQTT.

Topic Definition

  • Topic /{auth token}/{endpoint id}/{endpoint name}/{method name}/{direction}
  • Field Description
FieldDescriptionRemarks
auth tokenUUID assigned by supOS under Access Management.-
endpoint idCustom ID of the accessing device, recommended to be the MAC address of the gateway.-
endpoint nameName of the accessing device as defined by supOS under Access Management.-
direction
  • push: Request from cloud.
  • push_reply: Response to cloud request.
  • get: Gateway requests cloud.
  • get_reply: Cloud responds to gateway.
  • report: Actively send to cloud.
  • retain: Actively send to cloud, requesting cloud to retain the message, mainly used for synchronization of configuration, setup information with cloud.
Different method names support different topic directions.
  • Method Name List
FunctionMethod Name/Topic DirectionDescriptionRemarks
Device actively sends tag datametatag/retainUnidirectional upload, cloud does data persistence assuranceRequired
Device actively sends real-time datartdvalue/reportUnidirectional uploadRequired
Device actively sends cached resume datacachevalue/reportUnidirectional uploadRequired
Device actively sends eventsrtdevent/reportUnidirectional uploadOptional
Device actively sends requestsrtdevent/getEvent requestOptional, event support extensible, currently supports event: 1-System time synchronization
rtdevent/get_replyEvent response, no response is an exception, continuous no response can be considered as cloud exception
Cloud actively refreshes tag datametatag/pushMetadata active refresh request, requesting device to actively send a full set of tag data onceMandatory, cloud will only actively send refresh request when necessary
metatag/push_replyMetadata active refresh response, continuous no response can be considered as device exception
Cloud actively refreshes real-time datartdvalue/pushReal-time data active refresh request, requesting device to actively send a full set of real-time data onceMandatory, cloud will only actively send refresh request when necessary
rtdvalue/push_replyReal-time data refresh response, continuous no response can be considered as device exception
Cloud actively sends event notificationsrtdevent/pushEvent notification requestOptional
rtdevent/push_replyEvent notification response, continuous no response can be considered as device exception
Cloud actively sends write notificationsrtdnotify/pushCloud write notificationOptional, collectors supporting write features need to subscribe
rtdnotify/push_replyGateway write response
info

Examples in this section used the following information in the topic:

  • auth token: 86efdf12-4f54-4691-b833-09cbaa2d50a4
  • endpoint id: dev1234
  • endpoint name: test

Metatag

Device Actively Refreshes Tag

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/metatag/retain
MQTT Parameter
QoS = 0,Retain = 1
Message
MetaTagSequence
Remarks
The device will actively send tag meta data to supOS once turned on.

Cloud Requires Refreshing Tag

Cloud Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/metatag/push
MQTT Parameter
QoS = 1,Retain = 0
Message
None
Remarks
Refresh request will be automatically triggered from cloud when service restarted.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/metatag/push_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
MetaTagSequence

Real-time Data

Device Actively Sends Real-time Data

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdvalue/report
MQTT Parameter
QoS = 1,Retain = 0
Message
ValueSequence
Remarks
The device actively send real-time data after tag data sent.

Cloud Requires Refreshing Real-time Data

Cloud Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdvalue/push
MQTT Parameter
QoS = 1,Retain = 0
Message
None
Remarks
Refresh request will be automatically triggered from cloud when service restarted.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdvalue/push_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
ValueSequence

History Data

Device Actively Resumes History Data

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/cachevalue/report
MQTT Parameter
QoS = 1,Retain = 0
Message
ValueSequence
Remarks
The device stores real-time data that failed to be sent and resumes to send the data again when network restored.

Custom Event

Device Actively Reports Event

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/report
MQTT Parameter
QoS = 1,Retain = 0
Message
RtdEvent
Remarks

RtdEvent is reserved for devices to customize data report mechanism.

Device Requests Cloud Event

Device Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/get
MQTT Parameter
QoS = 1,Retain = 0
Message
RtdEvent
Remarks
Device requests and cloud is required to response.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/get_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
RtdEvent
Remarks
Cloud response.

Cloud Event Notification

Cloud Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/push
MQTT Parameter
QoS = 1,Retain = 0
Message
RtdEvent
Remarks
Cloud actively sends notifications to device according to business needs.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/push_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
RtdEvent
Remarks
Device reponses after processing the notified event.

System Embedded Event

System Time Synchronization

Device Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/get
MQTT Parameter
QoS = 1,Retain = 0
Message
  • RtdEvent
  • topic = SyncTime
  • payload = GatewayCoordinate
Remarks
Device actively sends request to cloud for time synchronization.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdevent/get_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
  • RtdEvent
  • topic = SyncTime
  • payload = ServerCoordinate
Remarks
Cloud responses to time synchronization request from device.

Cloud Sends Event Notification

Cloud Request

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdnotify/push
MQTT Parameter
QoS = 0,Retain = 1
Message
ValueSequence
Remarks
Cloud actively requests device to response.

Response

Topic
/86efdf12-4f54-4691-b833-09cbaa2d50a4/dev1234/test/rtdnotify/push_reply
MQTT Parameter
QoS = 1,Retain = 0
Message
None
Remarks
Device reponses to cloud.